import type {App} from "vue";

const myComponents = import.meta.glob('/src/components/MyComponent/**/**.vue')

// 注册全局组件
export function setupComponents(app: App<Element>) {
    for (let key in myComponents) {
        myComponents[key]().then(() => {
            const keys = key.split('/')
            const componentName = keys[keys.length - 1].split('.')[0]
            app.component(componentName)
        })
    }
}

